package com.jfinal.demo.core.entity;

import java.io.Serializable;
import java.util.Date;

import com.jfinal.plugin.activerecord.Model;

/**
 * 会员
 * 
 * @author Administrator
 * 
 */
public class Member extends Model<Member> implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static final Member dao = new Member();

	public boolean saveMember(Member member) {
		Date now = new Date();
		Integer id = member.getInt("id");
		member.set("updateDate", now);
		if (id == null) {
			member.set("createDate", now);
			return member.save();
		} else {
			return member.update();
		}
	}
}
